<#import "../inc/functions.ftl" as my>
<link href="assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet"
      type="text/css"/>
<link href="assets/global/plugins/icheck/skins/all.css" rel="stylesheet" type="text/css"/>

<div class="page-content">
    <div class="actions">
    </div>
    <div class="page-bar">
        <ul class="page-breadcrumb">
            <li>
                <i class="fa fa-home"></i>
                <a href="index.html">Home</a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="#">管理订单</a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="#">进行中订单</a>
            </li>
        </ul>
    </div>
    <div id="listRow">
        <div class="c-tool-bar">
            <form id="pageForm">
                <input type="hidden" id="pageNo" name="pageNo" value="${p.pageNo}"/>
                <input type="hidden" name="pageSize" value="${p.pageSize}"/>
                <input type="hidden" name="exprStatus" value="${(c.exprStatus)!''}"/>

                <input type="hidden" name="exprOrderNo" value="${(c.exprOrderNo)!''}"/>
                <input type="hidden" name="orderNo" value="${(c.orderNo)!''}"/>

                <input type="hidden" name="cstName" value="${(c.cstName)!''}"/>
                <input type="hidden" name="cstMobile" value="${(c.cstMobile)!''}"/>

                <input type="hidden" name="orderCctName" value="${(c.orderCctName)!''}"/>
                <input type="hidden" name="orderCctMobile" value="${(c.orderCctMobile)!''}"/>

                <input type="hidden" name="pkCctName" value="${(c.pkCctName)!''}"/>
                <input type="hidden" name="pkCctMobile" value="${(c.pkCctMobile)!''}"/>
            </form>
            <form class="form-horizontal" id="searchForm">
                <div class="row">
                    <div class="col-md-4">
                        <div class="form-group">
                            <label class="col-md-4 control-label">货物状态</label>
                            <div class="col-md-8">
                                <select class="form-control" name="exprStatus" id="exprStatus">
                                    <option value="">---请选择货物状态----</option>
                                    <option value="0">未到达</option>
                                    <option value="1">已到达</option>
                                    <option value="2">已提货</option>
                                    <option value="3">已送达</option>
                                    <option value="4">已签收</option>
                                    <option value="5">已核销</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label class="col-md-4 control-label">订单联系人</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" placeholder="订单联系人" id="orderCctName"
                                       name="orderCctName"
                                       value="${(c.orderCctName)!''}">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label class="col-md-4 control-label">订单联系人手机</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" placeholder="订单联系人手机" id="orderCctMobile"
                                       name="orderCctMobile"
                                       value="${(c.orderCctMobile)!''}">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-4">
                        <div class="form-group">
                            <label class="col-md-4 control-label">货运单号</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" placeholder="货运单号" id="exprOrderNo"
                                       name="exprOrderNo"
                                       value="${(c.exprOrderNo)!''}">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label class="col-md-4 control-label">取货联系人</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" placeholder="取货联系人" id="pkCctName"
                                       name="pkCctName"
                                       value="${(c.pkCctName)!''}">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label class="col-md-4 control-label">取货联系人手机</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" placeholder="取货联系人手机" id="pkCctMobile"
                                       name="pkCctMobile"
                                       value="${(c.pkCctMobile)!''}">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-4">
                        <div class="form-group">
                            <label class="col-md-4 control-label">客户姓名</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" placeholder="客户姓名" id="cstName"
                                       name="cstName"
                                       value="${(c.cstName)!''}">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label class="col-md-4 control-label">客户手机</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" placeholder="客户手机" id="cstMobile"
                                       name="cstMobile"
                                       value="${(c.cstMobile)!''}">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <button class="btn green" type="button" onclick="Order.Search.search()">搜索<i
                                class="fa fa-search"></i></button>
                    </div>
                </div>
            </form>
        </div>
        <table class="table table-hover table-striped">
            <thead>
            <tr>
                <th colspan="16"><a href="javascript:Order.Exporter.export()"><i class="fa fa-file-excel-o"></i> 导出(前200条)</a></th>
            </tr>
            <tr>
                <th>序号</th>
                <th>订单号</th>
                <th>订单联系人/手机</th>
                <th>服务类目/类型</th>
                <th>客户姓名/手机</th>
                <th>客户地址</th>
                <th>货运单号</th>
                <th>物流公司</th>
                <th>提货地址</th>
                <th style="min-width: 80px">货物状态</th>
                <th>提货电话</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <#if orderList?? && orderList?size gt 0>
                <#list orderList as l>
                <tr>
                    <td>${l_index+1}</td>
                    <td><a href="javascript:Order.Detail.show('${l.orderNo}')">${l.orderNo}</a>
                    <#if l.newOrder><span class="badge badge-roundless badge-danger">new</span></#if>
                    </td>
                    <td>${l.orderCctName!''}/${l.orderCctMobile!''}</td>
                    <td>${l.topCatName!''}/${l.svrName!''}</td>
                    <td>${l.cstName!''}/${l.cstMobile!''}</td>
                    <td>${l.cstAddrProv!''}${l.cstAddrCity!''}${l.cstAddrArea!''}${l.cstAddrDist!''}${l.cstAddrDetail!''}</td>
                    <td>${l.exprOrderNo!''}</td>
                    <td>${l.exprComName!''}</td>
                    <td>${l.pkAddr!''}</td>
                    <td><@my.exprStatusMenu l.id l.exprStatus l.exprStatusInt l.verify/>
                    </td>
                    <td>${l.pkCctMobile!''}</td>
                    <td>${l.createTime?string("yyyy-MM-dd HH:mm")}</td>
                    <td><a href="javascript:void(0)" onclick="Order.Action.orderCancel('${l.id}')">取消订单</a></td>
                </tr>
                </#list>
            <#else>
            <tr>
                <td colspan="16" style="color:red;text-align: center">未找到相关数据</td>
            </tr>
            </#if>
            </tbody>
        </table>
    <@my.page p "Order.Pagination.goto" />
    </div>
    <div id="detail"></div>
</div>

<script src="assets/global/plugins/icheck/icheck.min.js" type="text/javascript"></script>
<script src="assets/admin/pages/scripts/order/order_list.js" type="text/javascript"></script>
<script type="text/javascript">
    Order.Initializer.init();
    var searchForm = $("#searchForm");
    <#if c.exprStatus?? && c.exprStatus!=''>
        $("#exprStatus", searchForm).val("${c.exprStatus}");
    </#if>
</script>
